package com.lagou.jenkinsdemo.controller;

import com.lagou.jenkinsdemo.service.ArticleService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

@RestController //相当于配置 @Responsebody+@Controller
public class HelloController {

    @Resource
    private ArticleService articleService;

    @RequestMapping("/dockerdemo")
    public String demo() {
        Date date = new Date();
        SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd :hh:mm:ss");

        return "docker+git+jenkins+mysql 自动构建+自动部署  springboot+mybits  ，CICD springboot"+"mysql数据库查询结果：==="+articleService.queryArticle(1)+"======="+dateFormat.format(date);
    }


}
